package net.form.processing;

import java.util.List;

import net.form.processing.classification.EvaluadorHistograma;
import net.model.RasgoClase;
import net.service.ClaseManager;

public class KMeansOfObjectHSV extends KMeansOfObject {

	public KMeansOfObjectHSV(HSVRangeBackground rangeFondo,
			List<ObjetoClasificadorKmeans> objetos, int heft,
			List<RasgoClase> rasgo, ClaseManager claseManager) {
		super(rangeFondo, objetos, heft, rasgo);

		EvaluadorHistograma eh = (EvaluadorHistograma) er;
		eh.setClaseManager(claseManager);

	}

	@Override
	public Cluster initializeCluster(int id, int heft, double valor) {
		return new ClusterHSV(id, heft, valor);
	}

	public Cluster[] createClusters( int k) {
		// Here the clusters are taken with specific steps,
		// so the result looks always same with same image.
		// You can randomize the cluster centers, if you like.
		Cluster[] result = new Cluster[6];
//		//Valores fijo y por defecto por si no se encuentra en la BD.
//		result[0] = initializeCluster(0, this.heft, 12.297653045410378);
//		result[1] = initializeCluster(1, this.heft, 9.479109090241026);
//		result[2] = initializeCluster(2, this.heft, 3.0283676628747926);
//		result[3] = initializeCluster(3, this.heft, 5.207731534198162);
//		result[4] = initializeCluster(4, this.heft, 3.993868933104304);
		result[5] = initializeCluster(5, this.heft,0 );
		return completeClusters(result);
	}
}
